package com.beiyong;

import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import java.util.List;
@Service
public class Role {
    private int id;
    private String name;
    private String desc;
    private List<Permission> plist;

    public Role() {
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public List<Permission> getPlist() {
        return plist;
    }

    public void setPlist(List<Permission> plist) {
        this.plist = plist;
    }

    @Override
    public String toString() {
        return "Role{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", desc='" + desc + '\'' +
                ", plist=" + plist +
                '}';
    }
    //初始化方法注解
    @PostConstruct
    public void  a( ){
        System.out.println("aaaa");
    }
    //销毁方法注解
    @PreDestroy
    public void  b( ){
        System.out.println("bbbb");
    }
}
